<?php

use Illuminate\Http\Request;

/*
|--------------------------------------------------------------------------
| API Routes
|--------------------------------------------------------------------------
|
| Here is where you can register API routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| is assigned the "api" middleware group. Enjoy building your API!
|
*/

Route::middleware('auth:api')->get('/user', function (Request $request) {
    return $request->user();
});
Route::any('login/code', 'LoginController@code'); //获取验证码
Route::any('login/code_yz', 'LoginController@code_yz'); //验证手机验证码
Route::any('login/login', 'LoginController@login'); //密码登录
Route::any('login/repassword', 'LoginController@repassword'); //重置密码
; 

#【司机完善资料】
Route::group([
   'middleware' => 'jwt.api.auth',
    'prefix' => 'Chauffeur'

], function () {
    Route::any('index', 'ChauffeurController@index');//完善资料首页
    Route::any('uploadPhoto','ChauffeurController@uploadPhoto');//上传头像接口
    Route::any('addpost', 'ChauffeurController@addpost');//数据上传
    Route::any('upload', 'ChauffeurController@upload');//身份证上传
    Route::any('test', 'ChauffeurController@test');//uploadPhoto
    
});
Route::any('addpost', 'ChauffeurController@addpost');//数据上传
/*Route::any('Chauffeur/upload', 'ChauffeurController@upload');//

Route::any('Chauffeur/uploadPhoto', 'ChauffeurController@uploadPhoto');//uploadPhoto*/

Route::group([

   'middleware' => 'jwt.api.auth',
    // 'prefix' => 'Chauffeur'

], function () {
	
	Route::any('login/userinfo', 'LoginController@userinfo'); //个人中心页面赋值
    Route::any('login/edit', 'LoginController@edit'); //编辑资料页面赋值
	Route::any('login/uploadPhoto', 'LoginController@uploadPhoto'); //编辑资料页面上传图片
	Route::any('login/post_edit', 'LoginController@post_edit'); //编辑资料提交
	Route::any('login/mypurse', 'LoginController@mypurse'); //我的钱包  --- 暂时没做
	Route::any('login/myorder', 'LoginController@myorder'); //我的任务
	Route::any('login/msg', 'LoginController@msg'); //工作通知
	Route::any('login/editpassword', 'LoginController@editpassword'); //设置 -> 修改密码
	Route::any('login/fankui', 'LoginController@fankui'); //设置 -> 意见反馈
    Route::any('login/loginout', 'LoginController@loginout'); //退出登录
     Route::any('order/countdis', 'OrderController@countdis');
     Route::any('set/setlines', 'SetController@setLines');//出车、收车
});


Route::group([

   'middleware' => 'jwt.api.auth',


], function () {
    Route::any('order/carStatus', 'OrderController@carStatus');//主页-出收车状态
    Route::any('order/serOrderList', 'OrderController@serOrderList');//服务订单列表页
    Route::any('order/orderDetail', 'OrderController@orderDetail');//订单详情页
    Route::any('order/changeOrderStatus', 'OrderController@changeOrderStatus');//修改订单状态
    Route::any('order/driverDescription', 'OrderController@driverDescription');//司机对该订单的描述
    

});
